<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="common/import.jsp" %>
<html>
  <head>
     <title>用户登录</title>
     <link rel="stylesheet" href="${ctx}/resources/css/main.css" type="text/css" media="screen" />
     <script type="text/javascript">
        function onSubmit(){
        	if($("#loginForm").form('validate')){
        		$("#loginBt").val("登录中")
        		$("#loginBt").attr({"disabled":"disabled"});
        		document.forms[0].submit();
        		//$("#loginBt").removeAttr("disabled");
        	}
        }
        function reset(){
    		document.forms[0].reset();
    		document.getElementById('j_username').focus();
    	}
        $(function(){
        	$("html").die().live("keydown",function(event){
	   	        if(event.keyCode==13){
	   	        	onSubmit();
	   	        }
   	       });
        });
        $(window).resize(function(){
        	$("#loginDialog").window("center");
     	});
     </script>
  </head>
  <body style="visibility:visible">
	<div id="loginDialog" class="easyui-dialog" data-options="iconCls:'icon-home'" style="width:500px;height:300px;background:#fafafa;overflow:hidden"
			title="用户登录" collapsible="false" resizable="false" minimizable="false" maximizable="false" closable="false" border="false">
		<div class="header" style="height:60px;">
			<div class="toptitle"></div>
		</div>
		<div style="padding:50px 0;">
			<form action="${ctx}/login.do" method="post" id="loginForm">
				<div style="padding-left:150px">
					<table cellpadding="1" border=0 cellspacing="0">
						<tr>
							<td class="login-user" style="padding-left:17px">用户名</td>
							<td><input id="j_username" style ="width:140px;" name="userName" class="easyui-validatebox" 
							required="true" value="system" missingMessage="请输入用户名"></input></td>
						</tr>
						<tr>
							<td class="login-pwd" style="padding-left:17px">密&nbsp;&nbsp;码</td>
							<td><input id="j_password" style ="width:140px;" type="password" class="easyui-validatebox" 
							required="true" name="passWord" value="123456" missingMessage="请输入密码"></input></td>
						</tr>
						<!-- <tr>
							<td style="padding-left:17px">记住我</td>
							<td ><input type="checkbox" name="rememberMe" value="true"/></td>
						</tr>  -->
						<tr>
						    <td>&nbsp;</td>
							<td style="color: red; text-align: left; line-height:21px;">
							    <c:if test="${not empty errorMsg}">
							      <span>${errorMsg}</span>
							    </c:if>
							</td>
						</tr>
						<tr>
							<td>
							   &nbsp;
							</td>
							<td>
							   <input id="loginBt" type="button" class="btCls" value="登录" onclick="onSubmit()" />&nbsp;&nbsp;
						       <input type="button" class="btCls" value="重置" onclick="reset()" />
							</td>
						</tr>
					</table>
				</div>
				
			</form>
		</div>
	</div>
</body>
</html>
